<?php
$to = $_POST['to'];
$subject = $_POST['subject'];
$message = $_POST['message'];
if(($to && $subject && $message )=='')
{
    echo 'Please fill form properly.';
}

require_once 'class.phpmailer.php';
require_once 'class.smtp.php';

// including files in your send mail file.

$mail = new PHPMailer(); // create a object to that class.
$mail->IsMail();
$mail->Timeout  = 360;
$mail->Subject =  $subject;
$from ='SalusBaby';
$mail->From = 'salusbank.com';
$mail->FromName = 'SalusBank';
//$mail->AddReplyTo('mail@yourdomain.com', $from);
//$to = 'sjk.frills2008@gmail.com';
$mail->AddAddress($to, '');

$mail->IsHTML(false);
$mail->AddAttachment($_POST['filename'], 'attachment.pdf');
$mail->Body = "Look at your attachment.";

$mail->Send();
//echo 'sent';

header('Location:../../user');
?>
<a href="../../user/">Go Back to Home.</a>